export default {
    allCartList(state) {
        return state.shopCartList;
    },
    allSelectAllMoney(state) {
        return state.shopCartList.filter(item => item.checked)
            .reduce((pre, item) => {
                return pre + item.price * item.purchaseCount
            }, 0).toFixed(2);
    },
    isSelectAll(state) {
        if (state.shopCartList.length === 0) return false;
        return !state.shopCartList.some(item => !item.checked);
    }
}